package com.example.baselibrary.base

import com.example.baselibrary.net.http.ApiException


/**
 * Created by yechaoa on 2020/2/4.
 * Describe :
 */
class BaseBean<T>(
    val code: Int,
    private val data: T,
    val msg: String?
) {


    fun result(): T {
        if (code == 1) {
            return data
        } else {
            throw ApiException(0, msg ?: "")
        }
    }

}

